package com.gitee.absolute_spirit.hiot_android.data.source.network

import com.gitee.absolute_spirit.hiot_android.ui.home.HomeView
import com.gitee.absolute_spirit.hiot_android.ui.home.HomeViewState

data class NetworkDevice(
    val id: Int = 0,
    val location: String = "",
    val name: String = "",
    val type: String = "",
    val topic: String = "",
    val state: String = "",
)

fun NetworkDevice.toHomeViewState() = HomeViewState(
    id = id,
    location = location,
    name = name,
    type = type,
    topic = topic,
    state = state,
)

fun List<NetworkDevice>.toHomeViewState() = map(NetworkDevice::toHomeViewState)